﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace TestJsonPRICH
{
    //这里相当于控制器，
    class FxTestControl
    {
        private readonly IOptionsSnapshot<WebConfigEntity> _snapshot;
        public FxTestControl(IOptionsSnapshot<WebConfigEntity> snapshot)
        {
            this._snapshot = snapshot;
        }

        public void Test()
        {
            var snapVal = _snapshot.Value;
            Console.WriteLine(snapVal.sqlConnectionString.ConnectionString);
            Console.WriteLine(snapVal.sqlConnectionString.ProviderName);
            Console.WriteLine(snapVal.name.Key);
            Console.WriteLine(snapVal.name.Value);

        }
    }
}
